package
{
	import com.soyhon.ds.sort.SortSlgorithms;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.utils.getTimer;

	/**
	 * ...
	 * @author soyhon
	 * @date 2011/4/17 22:52
	 */
	public class Main extends Sprite
	{
		public function Main() : void
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}

		private function init(e : Event = null) : void
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			var tmp:Array = new Array();
			for (var i:int = 0; i < 9999; i++)
			{
				tmp[i] = Math.random() * 99999 >> 0;
			}
			//trace(tmp);
			var t:int = getTimer();
            SortSlgorithms.quickSort(0, tmp.length - 1, tmp);
			trace(getTimer() - t);
			trace(tmp);
		}
	}
}